package com.spsy.pay.service.impl;

import java.util.List;
import com.spsy.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.spsy.pay.mapper.PaymentOrderMapper;
import com.spsy.pay.domain.PaymentOrder;
import com.spsy.pay.service.IPaymentOrderService;

/**
 * 支付订单Service业务层处理
 * 
 * @author arhat
 * @date 2025-05-26
 */
@Service
public class PaymentOrderServiceImpl implements IPaymentOrderService 
{
    @Autowired
    private PaymentOrderMapper paymentOrderMapper;

    /**
     * 查询支付订单
     * 
     * @param id 支付订单主键
     * @return 支付订单
     */
    @Override
    public PaymentOrder selectPaymentOrderById(Long id)
    {
        return paymentOrderMapper.selectPaymentOrderById(id);
    }

    /**
     * 查询支付订单列表
     * 
     * @param paymentOrder 支付订单
     * @return 支付订单
     */
    @Override
    public List<PaymentOrder> selectPaymentOrderList(PaymentOrder paymentOrder)
    {
        return paymentOrderMapper.selectPaymentOrderList(paymentOrder);
    }

    /**
     * 新增支付订单
     * 
     * @param paymentOrder 支付订单
     * @return 结果
     */
    @Override
    public int insertPaymentOrder(PaymentOrder paymentOrder)
    {
        paymentOrder.setCreateTime(DateUtils.getNowDate());
        return paymentOrderMapper.insertPaymentOrder(paymentOrder);
    }

    /**
     * 修改支付订单
     * 
     * @param paymentOrder 支付订单
     * @return 结果
     */
    @Override
    public int updatePaymentOrder(PaymentOrder paymentOrder)
    {
        paymentOrder.setUpdateTime(DateUtils.getNowDate());
        return paymentOrderMapper.updatePaymentOrder(paymentOrder);
    }


    @Override
    public int updatePaymentOrderByOrderNo(PaymentOrder paymentOrder)
    {
        paymentOrder.setUpdateTime(DateUtils.getNowDate());
        return paymentOrderMapper.updatePaymentOrderByOrderNo(paymentOrder);
    }




    /**
     * 批量删除支付订单
     * 
     * @param ids 需要删除的支付订单主键
     * @return 结果
     */
    @Override
    public int deletePaymentOrderByIds(Long[] ids)
    {
        return paymentOrderMapper.deletePaymentOrderByIds(ids);
    }

    /**
     * 删除支付订单信息
     * 
     * @param id 支付订单主键
     * @return 结果
     */
    @Override
    public int deletePaymentOrderById(Long id)
    {
        return paymentOrderMapper.deletePaymentOrderById(id);
    }
}
